#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableSceneClientDao:DaoBase<TableSceneClient>
    {
        public override string GetFileName()
        {
            return "TableSceneClient.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableSceneClient>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddOneIndex(TableSceneClient model)
        {
            if (!cacheOneIndex.ContainsKey(model.sceneName.ToString()))
            {
                cacheOneIndex[model.sceneName.ToString()] = new List<TableSceneClient>();
            }
            cacheOneIndex[model.sceneName.ToString()].Add(model);
        }
        public override void AddPrimaryIndex(TableSceneClient model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableSceneClient->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableSceneClient ParseRowData(string[] rowData)
        {
            TableSceneClient data = new TableSceneClient();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.sceneText = string.Intern(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.sceneName = string.Intern(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.sceneResName = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.miniMap = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.bigMap = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.enableBigMap = int.Parse(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.enableWorldMap = int.Parse(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.bgSound = string.Intern(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.firstEnterPlotSeqId = int.Parse(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.cameraParam = int.Parse(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.fightSceneId = ParseData<int>(rowData[11]);
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.offsetX = float.Parse(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.offsetY = float.Parse(rowData[13]);
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.mapSizeX = float.Parse(rowData[14]);
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.mapSizeZ = float.Parse(rowData[15]);
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.minimapOriginX = float.Parse(rowData[16]);
            }
            if (!string.IsNullOrEmpty(rowData[17]))
            {
                data.minimapOriginY = float.Parse(rowData[17]);
            }
            if (!string.IsNullOrEmpty(rowData[18]))
            {
                data.minimapScaleX = float.Parse(rowData[18]);
            }
            if (!string.IsNullOrEmpty(rowData[19]))
            {
                data.minimapScaleY = float.Parse(rowData[19]);
            }
            if (!string.IsNullOrEmpty(rowData[20]))
            {
                data.bigmapOffsetX = float.Parse(rowData[20]);
            }
            if (!string.IsNullOrEmpty(rowData[21]))
            {
                data.bigmapOffsetY = float.Parse(rowData[21]);
            }
            if (!string.IsNullOrEmpty(rowData[22]))
            {
                data.bigmapScaleX = float.Parse(rowData[22]);
            }
            if (!string.IsNullOrEmpty(rowData[23]))
            {
                data.bigmapScaleY = float.Parse(rowData[23]);
            }
            if (!string.IsNullOrEmpty(rowData[24]))
            {
                data.mapRotation = float.Parse(rowData[24]);
            }
            if (!string.IsNullOrEmpty(rowData[25]))
            {
                data.sceneIcon = rowData[25];
            }
            if (!string.IsNullOrEmpty(rowData[26]))
            {
                data.sceneEvent = int.Parse(rowData[26]);
            }
            if (!string.IsNullOrEmpty(rowData[27]))
            {
                data.fieldViewLevel = rowData[27];
            }
            if (!string.IsNullOrEmpty(rowData[28]))
            {
                data.fieldViewSortIndex = int.Parse(rowData[28]);
            }
            if (!string.IsNullOrEmpty(rowData[29]))
            {
                data.fieldViewOpenConfig = int.Parse(rowData[29]);
            }
            return data;
        }
    }
}
